home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_560 / stscan / readme < prev    next >
Text File  |  1992-05-06  |  6KB  |  205 lines

  1. Siemens ST 400 Scanner Software
  2. -------------------------------
  3.  
  4. Author:
  5.  
  6. Frank-Christian Krügel
  7. Rabienstraße 52
  8. W-2862 Worpswede
  9. Great Germany
  10. Phone: +49-4792-894
  11. Fax: same number, fax machine starts after 5 rings
  12. Bitnet/EARN: A02E@DHBRRZ41.BITNET
  13.  
  14.  
  15.  
  16. Licence:
  17.  
  18. This software is freeware.  This means that anybody is allowed to do
  19. anything with it (duplicating, modifying,...) as long as:
  20. - My name stays in this program.  The copyright remains to me also for
  21.   modified versions.
  22. - The program is given away for free.  Only the disk and postage may be
  23.   charged.
  24. - Commercial use needs written permission
  25.  
  26.  
  27. Acknowledgements:
  28.  
  29. I have to thank Charles Heath of Microsmith for his famous file requester,
  30. which I have used here. Unfortunately I had to change some small things:
  31. - Colors:  Due to the specific color palette this program requires the
  32.   original color settings were like a dark man in a tunnel - you saw nothing.
  33. - I removed the 'static' declaration of the rfnam() function in order to
  34.   be able to use it from the main program.
  35. Due to the author's restrictions I am only allowed to supply the requester
  36. in object form.  The (unmodified!) source code is on the 4th Aztec C Disk,
  37. so this should be no problem.
  38.  
  39.  
  40. Purpose:
  41.  
  42. This program was born from the need of connecting a flatbed scanner with
  43. SCSI bus to my Amiga. It controls size (A4 or A5), number of gray scales
  44. (2 or 16) and threshold settings.
  45.  
  46. In grayscale mode the scanner sends one byte per scanner pixel and uses 64
  47. steps of gray.  These files take away a lot of memory (up to 16 Megs!) and
  48. cannot be previewed on an Amiga, which can only display 16 shades of gray.
  49. So the two least significant bits are thrown away.  For printing or using
  50. the scanned images in DTP programs grayscale pictures can be converted into
  51. bilevel (black and white) pictures.  Both Floyd-Steinberg and Ordered
  52. Dither are available for conversion.
  53.  
  54. Images can be saved to disk as IFF either completely or only a small window
  55. of them.  An image load routine is not included since I didn't need none.
  56. Everyone is free to add such a routine as well as saving images in
  57. compressed form (optionally) and send me his results.
  58.  
  59. In the right bottom there is a button for switching between full page
  60. display and window display.
  61.  
  62. Almost all scanner specific things are in the scan() function. So it should
  63. be quite simple to adapt this program to different scanners. If there is a
  64. need, simply send me the scanner and the manual, so I can create a
  65. special version for it.
  66.  
  67. This program is not 'complete'. (Name a program and I tell you what should
  68. be added!) It should be considered a first step to the final solution.
  69.  
  70.  
  71. You need:
  72.  
  73. - This disk
  74. - an Amiga
  75. - at best a flicker-free screen
  76. - as much memory as you can get (the largest pictures need 8MB)
  77. - a SCSI interface with the Commodore 'Exec level Direct SCSI' programming
  78.   interface
  79. - a SCSI scanner with cable. When using not a Siemens scanner the program
  80.   has to be adapted and recompiled
  81. - Aztec C 5.0 (It should also work with Lattice, but this is untested!)
  82.   for Recompiling
  83.  
  84.  
  85. Recompiling:
  86.  
  87. Simply change to the directory containing all source files and type 'make'.
  88. The program does not rely on specific path names etc.
  89.  
  90.  
  91. Start:
  92.  
  93. Type 'stscan' or double-click icon. Make sure that the scanner is ready
  94. when booting and when starting the program. Note: The Siemens Scanner
  95. is hardwired on SCSI Unit 3, LUN3. Do not have any other SCSI device
  96. with the same unit number connected to the bus
  97.  
  98.  
  99. How the Siemens Scanner works:
  100.  
  101. For a better understanding here is a short description of how the scanner is
  102. controlled.
  103.  
  104.  
  105. 1. Turn scanner light on:
  106.    Send 'Mode Select' with Vendor Specific Bit (bit 7 of 5th byte of cdb) set
  107.  
  108.     Command Descriptor Block:
  109.     0x15 (Command)
  110.     (LUN<<5)
  111.     0
  112.     0
  113.     0
  114.     128 (Vendor Specific Bit)
  115.  
  116. 2. Wait 2 sec. for maximum light intensity
  117.  
  118. 3. Send window descriptor block to scanner
  119.  
  120.     Command Descriptor Block:
  121.     0x24 (Command)
  122.     (LUN<<5)
  123.     0
  124.     0
  125.     0
  126.     0
  127.     0
  128.     Upper byte of data length, always 0
  129.     Lower byte of data length, always 40=0x28
  130.     0
  131.  
  132.     Window Descriptor Block
  133.     typedef struct DefWindow
  134.     {  ULONG dummy1;
  135.        UWORD dummy2;
  136.        UWORD wpsize;    /*data length - 8*/
  137.        UBYTE winnr;        /*window number starting with 1*/
  138.        UBYTE dummy3;
  139.        UWORD resx;        /*horizontal resolution in dpi*/
  140.        UWORD resy;        /*verical resolution, same as horizontal*/
  141.        UWORD cornerx;    /*left upper corner..*/
  142.        UWORD cornery;    /*..of scanning area*/
  143.        UWORD width;        /*size of ..*/
  144.        UWORD height;    /*..scanning area*/
  145.        UBYTE dummy4;
  146.        UBYTE threshold;    /*0..63*/
  147.        UBYTE size;        /* temporary storage, ignored by scanner */
  148.        UBYTE halftone;    /*0:bilevel 2:grayscale*/
  149.        UBYTE bitspixel;    /*1:bilevel 8:grayscale*/
  150.        UBYTE dummy5;
  151.        UWORD dummy6;
  152.        ULONG dummy7;
  153.     };
  154.     Dummies are set to 0.
  155.  
  156. 4. Start scanning
  157.  
  158.     Command Descriptor Block:
  159.     0x1b (Command)
  160.     (LUN<<5)
  161.     0
  162.     0
  163.     0
  164.     0
  165.  
  166. 5. Read 32k of data until the complete image has been read
  167.  
  168.     Command Descriptor Block:
  169.     0x28 (Command)
  170.     (LUN<<5)
  171.     0
  172.     0
  173.     0
  174.     0
  175.     0
  176.     Upper byte of data length
  177.     Lower byte of data length
  178.     0
  179.  
  180. 6. Turn Scanner light off
  181.  
  182.    Send 'Mode Select' with Vendor Specific Bit (bit 7 of 5th byte of cdb) reset
  183.  
  184.     Command Descriptor Block:
  185.     0x15 (Command)
  186.     (LUN<<5)
  187.     0
  188.     0
  189.     0
  190.     0 (Vendor Specific Bit)
  191.  
  192. The scanner only has 2 MB of internal memory.  Large gray scale images can
  193. exceed this memory limit.  In this case you have to divide to page into
  194. horizontal stripes with the full width and a maximum height of
  195. (0x200000L/width) raster lines, which produce less than 2 MB each.  Then
  196. scan each stripe as described above util the whole picture is processed.
  197.  
  198.  
  199. Still To Do:
  200.  
  201. - optional IFF graphics compression when saving
  202. - IFF loader (although I've never missed it)
  203. - maybe some kind of print utility (external?)
  204. - Image processing functions (FIR filter, etc)
  205.